//
//  InfoData.m
//  __PRODUCTNAME__
//
//  Created by LL.F on 16/09/12
//  Copyright (c) __ORGANIZATIONNAME__. All rights reserved.
//

#import "InfoData.h"
#import "InfoRelates.h"
#import "InfoDishes_List.h"

@implementation InfoData

+ (NSDictionary *)objectClassInArray{
    return @{@"relates" : [InfoRelates class], @"dishes_list" : [InfoDishes_List class]};
}
- (void)setValue:(id)value forKey:(NSString *)key
{
    
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"relates"]) {
        NSMutableArray<InfoRelates *>  *secDataArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            InfoRelates *secData = [InfoRelates modelWithDic:dic];
            [secDataArray addObject:secData];
        }
        _relates = secDataArray;
    }
    if ([key isEqualToString:@"dishes_list"]) {
        NSMutableArray<InfoDishes_List *>  *secDataArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            InfoDishes_List *secData = [InfoDishes_List modelWithDic:dic];
            [secDataArray addObject:secData];
        }
        _dishes_list = secDataArray;
    }
}
@end
